<template>
  <div class="goods">
    <goods-list-item v-for="(item,index) in goods" :key="index" :goods-item="item"></goods-list-item>
  </div>
</template>

<script>
import GoodsListItem from "./GoodListItem";
export default {
  name: "GoodsList",
  props: {
    goods: {
      type: Array,
      defalut() {
        return [];
      },
    },
  },
  components: {
    GoodsListItem,
  },
};
</script>

<style scpoed>
.goods {
  display: flex;
  /* flex-wrap 根据子元素的宽度决定一行显示多少个子元素 */
  flex-wrap: wrap;
  /* space-around 将元素均等分 */
  justify-content: space-evenly;
  /* padding: 2px; */
}
</style>